import json
import os

SETTINGS_FILE = "settings.json"

DEFAULT_SETTINGS = {
    "proxy": {
        "enable": False,
        "http": "",
        "https": "",
        "username": "",
        "password": ""
    }
}

def load_settings():
    if os.path.exists(SETTINGS_FILE):
        with open(SETTINGS_FILE, 'r') as f:
            return json.load(f)
    return DEFAULT_SETTINGS

def save_settings(settings):
    with open(SETTINGS_FILE, 'w') as f:
        json.dump(settings, f, indent=2) 